<template>
	<div id="">
		<van-row style="height: 7vh;">
			<van-col span="24"></van-col>
		</van-row>
		<van-row>
			<van-col span="24" style="padding:0 0 0.625rem 0.8125rem;font-size: 1.25rem;font-weight: 600;">{{time}}
			</van-col>
		</van-row>
		<van-row>
			<van-col span="21">
				<van-search placeholder="请输入你想要的商品" @click="search" style="height: 2.1875rem;" />
			</van-col>
			<van-col span="3" style="text-align: center;line-height: 2.5rem;font-size: 1.9375rem;">
				<van-icon name="chat-o" />
			</van-col>
		</van-row>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				time: ''
			};
		},
		created() {
			let date = new Date()
			console.log(date.getHours())
			if (date.getHours() > 7 && date.getHours() < 12) {
				this.time = '早上好'
			} else if (date.getHours() > 13 && date.getHours() < 17) {
				this.time = '下午好'
			} else {
				this.time = '晚上好'
			}
		},
		methods:{
			search(){
				// console.log(122)
				this.$router.push('/search')
			}
		}
	}
</script>

<style>
	.van-search .van-cell {
		line-height: 30px;
	}
</style>
